from django.db import models

# Create your models here.

class Article(models.Model):
    # 文章的唯一ID
    article_id = models.AutoField(primary_key=True)
    # 文章标题
    title = models.TextField('标题', max_length=50)
    # 文章的摘要
    brief_content = models.TextField('摘要', max_length=200)
    # 文章的内容
    content = models.TextField()
    # 文章的发布日期
    publish_date = models.DateTimeField('发布时间', null=True)

    # def __str__(self):
    #     return self.name
    class Meta:
        db_table = 'Article'
        verbose_name = '文章'
        verbose_name_plural = verbose_name
        ordering = ['-publish_date']